/*
 * Copyright (c) 2020 Fraunhofer FOKUS and others. All rights reserved.
 *
 * See the NOTICE file(s) distributed with this work for additional
 * information regarding copyright ownership.
 *
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Public License 2.0 which is available at
 * http://www.eclipse.org/legal/epl-2.0
 *
 * SPDX-License-Identifier: EPL-2.0
 *
 * Contact: mosaic@fokus.fraunhofer.de
 */
package org.eclipse.mosaic.lib.objects.mapping;

import org.eclipse.mosaic.lib.geo.GeoPoint;
import org.eclipse.mosaic.lib.geo.GeoSector;

import java.util.List;

/**
 * A Multi-Access Edge Computing Simulation Unit that is equipped with appplication
 */
public class MecMapping extends UnitMapping {

    private static final long serialVersionUID = 1L;

    private final String extName;

    private final GeoPoint position;

    private final double radius;

    private final double heading;

    private final double angle;

    private final GeoSector area;

    private final boolean enableShow;

    /**
     * Creates a new ApplicationUnit.
     *
     * @param name         The name of the unit.
     * @param group        The name of the units' group.
     * @param applications The list of applications the unit is equipped with.
     */
    public MecMapping(final String name,
               final String group,
               final List<String> applications,
               final String extName,
               final GeoPoint position,
               final double radius,
               final double heading,
               final double angle,
               final boolean enableShow
   ) {
        super(name, group, applications);
        this.extName = extName;
        this.position = position;
        this.radius = radius;
        this.heading = heading;
        this.angle = angle;
        this.enableShow = enableShow;

        double begin = heading - angle / 2;
        double end = heading + angle / 2;
        this.area = new GeoSector(position, radius, begin, end);
    }

    public String getExtName() {
        return extName;
    }

    public GeoPoint getPosition() {
        return position;
    }

    public double getRadius() {
        return radius;
    }

    public double getHeading() {
        return heading;
    }

    public double getAngle() {
        return angle;
    }

    public GeoSector getArea() {
        return area;
    }

    public boolean getEnableShow() {
        return enableShow;
    }
}
